{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-06-07T02:41:44.077370300Z",
     "start_time": "2025-06-07T02:41:44.049341600Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1100 entries, 0 to 1099\n",
      "Data columns (total 31 columns):\n",
      " #   Column                    Non-Null Count  Dtype \n",
      "---  ------                    --------------  ----- \n",
      " 0   Attrition                 1100 non-null   int64 \n",
      " 1   Age                       1100 non-null   int64 \n",
      " 2   BusinessTravel            1100 non-null   object\n",
      " 3   Department                1100 non-null   object\n",
      " 4   DistanceFromHome          1100 non-null   int64 \n",
      " 5   Education                 1100 non-null   int64 \n",
      " 6   EducationField            1100 non-null   object\n",
      " 7   EmployeeNumber            1100 non-null   int64 \n",
      " 8   EnvironmentSatisfaction   1100 non-null   int64 \n",
      " 9   Gender                    1100 non-null   object\n",
      " 10  JobInvolvement            1100 non-null   int64 \n",
      " 11  JobLevel                  1100 non-null   int64 \n",
      " 12  JobRole                   1100 non-null   object\n",
      " 13  JobSatisfaction           1100 non-null   int64 \n",
      " 14  MaritalStatus             1100 non-null   object\n",
      " 15  MonthlyIncome             1100 non-null   int64 \n",
      " 16  NumCompaniesWorked        1100 non-null   int64 \n",
      " 17  Over18                    1100 non-null   object\n",
      " 18  OverTime                  1100 non-null   object\n",
      " 19  PercentSalaryHike         1100 non-null   int64 \n",
      " 20  PerformanceRating         1100 non-null   int64 \n",
      " 21  RelationshipSatisfaction  1100 non-null   int64 \n",
      " 22  StandardHours             1100 non-null   int64 \n",
      " 23  StockOptionLevel          1100 non-null   int64 \n",
      " 24  TotalWorkingYears         1100 non-null   int64 \n",
      " 25  TrainingTimesLastYear     1100 non-null   int64 \n",
      " 26  WorkLifeBalance           1100 non-null   int64 \n",
      " 27  YearsAtCompany            1100 non-null   int64 \n",
      " 28  YearsInCurrentRole        1100 non-null   int64 \n",
      " 29  YearsSinceLastPromotion   1100 non-null   int64 \n",
      " 30  YearsWithCurrManager      1100 non-null   int64 \n",
      "dtypes: int64(23), object(8)\n",
      "memory usage: 266.5+ KB\n"
     ]
    }
   ],
   "source": [
    "# 导包\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "# 随机森林\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "\n",
    "# 读取数据\n",
    "data = pd.read_csv('../data/train.csv')\n",
    "data.info()\n",
    "# 删除无用列\n",
    "data = data.drop(['StandardHours'], axis=1)\n",
    "\n",
    "#  数据预处理\n",
    "x = data.drop(['Attrition'], axis=1)\n",
    "y = data['Attrition']\n",
    "x = pd.get_dummies(x).astype(int)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [
    {
     "data": {
      "text/plain": "      Age  DistanceFromHome  Education  EmployeeNumber  \\\n0      37                 1          4              77   \n1      54                 1          4            1245   \n2      34                 7          3             147   \n3      39                 1          1            1026   \n4      28                 1          3            1111   \n...   ...               ...        ...             ...   \n1095   35                23          4              75   \n1096   38                 2          4            1835   \n1097   37                16          4             868   \n1098   22                 7          1            1878   \n1099   26                 2          3            1053   \n\n      EnvironmentSatisfaction  JobInvolvement  JobLevel  JobSatisfaction  \\\n0                           1               2         2                3   \n1                           4               3         3                3   \n2                           1               1         2                3   \n3                           4               2         4                4   \n4                           1               2         1                2   \n...                       ...             ...       ...              ...   \n1095                        3               3         1                1   \n1096                        2               1         2                4   \n1097                        4               2         2                3   \n1098                        4               3         1                2   \n1099                        1               3         1                1   \n\n      MonthlyIncome  NumCompaniesWorked  ...  JobRole_Research Director  \\\n0              5993                   1  ...                          0   \n1             10502                   7  ...                          0   \n2              6074                   1  ...                          0   \n3             12742                   1  ...                          0   \n4              2596                   1  ...                          0   \n...             ...                 ...  ...                        ...   \n1095           4014                   3  ...                          0   \n1096           5405                   2  ...                          0   \n1097           6334                   4  ...                          0   \n1098           2472                   1  ...                          0   \n1099           2042                   6  ...                          0   \n\n      JobRole_Research Scientist  JobRole_Sales Executive  \\\n0                              0                        0   \n1                              0                        0   \n2                              0                        0   \n3                              0                        0   \n4                              0                        0   \n...                          ...                      ...   \n1095                           0                        0   \n1096                           0                        0   \n1097                           0                        1   \n1098                           1                        0   \n1099                           1                        0   \n\n      JobRole_Sales Representative  MaritalStatus_Divorced  \\\n0                                0                       1   \n1                                0                       1   \n2                                0                       0   \n3                                0                       0   \n4                                0                       1   \n...                            ...                     ...   \n1095                             0                       0   \n1096                             1                       0   \n1097                             0                       1   \n1098                             0                       0   \n1099                             0                       0   \n\n      MaritalStatus_Married  MaritalStatus_Single  Over18_Y  OverTime_No  \\\n0                         0                     0         1            1   \n1                         0                     0         1            1   \n2                         0                     1         1            0   \n3                         1                     0         1            1   \n4                         0                     0         1            1   \n...                     ...                   ...       ...          ...   \n1095                      1                     0         1            0   \n1096                      1                     0         1            0   \n1097                      0                     0         1            1   \n1098                      0                     1         1            0   \n1099                      1                     0         1            0   \n\n      OverTime_Yes  \n0                0  \n1                0  \n2                1  \n3                0  \n4                0  \n...            ...  \n1095             1  \n1096             1  \n1097             0  \n1098             1  \n1099             1  \n\n[1100 rows x 50 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Age</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>JobInvolvement</th>\n      <th>JobLevel</th>\n      <th>JobSatisfaction</th>\n      <th>MonthlyIncome</th>\n      <th>NumCompaniesWorked</th>\n      <th>...</th>\n      <th>JobRole_Research Director</th>\n      <th>JobRole_Research Scientist</th>\n      <th>JobRole_Sales Executive</th>\n      <th>JobRole_Sales Representative</th>\n      <th>MaritalStatus_Divorced</th>\n      <th>MaritalStatus_Married</th>\n      <th>MaritalStatus_Single</th>\n      <th>Over18_Y</th>\n      <th>OverTime_No</th>\n      <th>OverTime_Yes</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>37</td>\n      <td>1</td>\n      <td>4</td>\n      <td>77</td>\n      <td>1</td>\n      <td>2</td>\n      <td>2</td>\n      <td>3</td>\n      <td>5993</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>54</td>\n      <td>1</td>\n      <td>4</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>3</td>\n      <td>10502</td>\n      <td>7</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>34</td>\n      <td>7</td>\n      <td>3</td>\n      <td>147</td>\n      <td>1</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>6074</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>39</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>4</td>\n      <td>12742</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>28</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>2596</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>35</td>\n      <td>23</td>\n      <td>4</td>\n      <td>75</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>1</td>\n      <td>4014</td>\n      <td>3</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>38</td>\n      <td>2</td>\n      <td>4</td>\n      <td>1835</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>4</td>\n      <td>5405</td>\n      <td>2</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>37</td>\n      <td>16</td>\n      <td>4</td>\n      <td>868</td>\n      <td>4</td>\n      <td>2</td>\n      <td>2</td>\n      <td>3</td>\n      <td>6334</td>\n      <td>4</td>\n      <td>...</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>22</td>\n      <td>7</td>\n      <td>1</td>\n      <td>1878</td>\n      <td>4</td>\n      <td>3</td>\n      <td>1</td>\n      <td>2</td>\n      <td>2472</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>26</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1053</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1</td>\n      <td>1</td>\n      <td>2042</td>\n      <td>6</td>\n      <td>...</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 50 columns</p>\n</div>"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-06-07T02:41:50.160034900Z",
     "start_time": "2025-06-07T02:41:50.144090700Z"
    }
   },
   "id": "5a07cb090c95e18"
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "      Attrition  Age     BusinessTravel              Department  \\\n0             0   37      Travel_Rarely  Research & Development   \n1             0   54  Travel_Frequently  Research & Development   \n2             1   34  Travel_Frequently  Research & Development   \n3             0   39      Travel_Rarely  Research & Development   \n4             1   28  Travel_Frequently  Research & Development   \n...         ...  ...                ...                     ...   \n1095          0   35      Travel_Rarely  Research & Development   \n1096          0   38      Travel_Rarely                   Sales   \n1097          0   37      Travel_Rarely                   Sales   \n1098          1   22      Travel_Rarely  Research & Development   \n1099          1   26  Travel_Frequently  Research & Development   \n\n      DistanceFromHome  Education EducationField  EmployeeNumber  \\\n0                    1          4  Life Sciences              77   \n1                    1          4  Life Sciences            1245   \n2                    7          3  Life Sciences             147   \n3                    1          1  Life Sciences            1026   \n4                    1          3        Medical            1111   \n...                ...        ...            ...             ...   \n1095                23          4        Medical              75   \n1096                 2          4      Marketing            1835   \n1097                16          4      Marketing             868   \n1098                 7          1  Life Sciences            1878   \n1099                 2          3  Life Sciences            1053   \n\n      EnvironmentSatisfaction  Gender  ...  PerformanceRating  \\\n0                           1    Male  ...                  3   \n1                           4  Female  ...                  3   \n2                           1    Male  ...                  4   \n3                           4  Female  ...                  3   \n4                           1    Male  ...                  3   \n...                       ...     ...  ...                ...   \n1095                        3  Female  ...                  3   \n1096                        2  Female  ...                  4   \n1097                        4    Male  ...                  3   \n1098                        4    Male  ...                  4   \n1099                        1    Male  ...                  3   \n\n      RelationshipSatisfaction StockOptionLevel  TotalWorkingYears  \\\n0                            3                1                  7   \n1                            1                1                 33   \n2                            4                0                  9   \n3                            3                1                 21   \n4                            1                2                  1   \n...                        ...              ...                ...   \n1095                         3                1                  4   \n1096                         1                2                 20   \n1097                         4                2                  9   \n1098                         1                0                  1   \n1099                         2                1                  6   \n\n     TrainingTimesLastYear  WorkLifeBalance  YearsAtCompany  \\\n0                        2                4               7   \n1                        2                1               5   \n2                        3                3               9   \n3                        3                3              21   \n4                        2                3               1   \n...                    ...              ...             ...   \n1095                     3                3               2   \n1096                     4                2               4   \n1097                     2                3               1   \n1098                     2                3               1   \n1099                     2                3               3   \n\n     YearsInCurrentRole YearsSinceLastPromotion  YearsWithCurrManager  \n0                     5                       0                     7  \n1                     4                       1                     4  \n2                     7                       0                     6  \n3                     6                      11                     8  \n4                     0                       0                     0  \n...                 ...                     ...                   ...  \n1095                  2                       2                     2  \n1096                  2                       0                     3  \n1097                  0                       0                     0  \n1098                  0                       0                     0  \n1099                  2                       1                     2  \n\n[1100 rows x 30 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Attrition</th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>Gender</th>\n      <th>...</th>\n      <th>PerformanceRating</th>\n      <th>RelationshipSatisfaction</th>\n      <th>StockOptionLevel</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n      <th>WorkLifeBalance</th>\n      <th>YearsAtCompany</th>\n      <th>YearsInCurrentRole</th>\n      <th>YearsSinceLastPromotion</th>\n      <th>YearsWithCurrManager</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>0</td>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>77</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>7</td>\n      <td>2</td>\n      <td>4</td>\n      <td>7</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>0</td>\n      <td>54</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>3</td>\n      <td>1</td>\n      <td>1</td>\n      <td>33</td>\n      <td>2</td>\n      <td>1</td>\n      <td>5</td>\n      <td>4</td>\n      <td>1</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>34</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>147</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>4</td>\n      <td>4</td>\n      <td>0</td>\n      <td>9</td>\n      <td>3</td>\n      <td>3</td>\n      <td>9</td>\n      <td>7</td>\n      <td>0</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>0</td>\n      <td>39</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>21</td>\n      <td>3</td>\n      <td>3</td>\n      <td>21</td>\n      <td>6</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>28</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>3</td>\n      <td>1</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>0</td>\n      <td>35</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>23</td>\n      <td>4</td>\n      <td>Medical</td>\n      <td>75</td>\n      <td>3</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>0</td>\n      <td>38</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>1835</td>\n      <td>2</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>4</td>\n      <td>1</td>\n      <td>2</td>\n      <td>20</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>2</td>\n      <td>0</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>0</td>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>16</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>868</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>3</td>\n      <td>4</td>\n      <td>2</td>\n      <td>9</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>1</td>\n      <td>22</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1878</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>4</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>1</td>\n      <td>26</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>2</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1053</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>6</td>\n      <td>2</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 30 columns</p>\n</div>"
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-06-07T02:35:33.776123400Z",
     "start_time": "2025-06-07T02:35:33.765524600Z"
    }
   },
   "id": "21c9852672c2685f"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
